#include <stdio.h>

int main()
{

    // break 协助完成多路选一。break 跳出 switch 选择结构。
    // switch 中的表达式，整型和字符型的表达式。
    // case 为整型常量表达式。

#if 0
    int choice;
    printf(" pls input your choice:\n");
    scanf("%d",&choice);
    switch (choice) {
        case 1:
            printf("HHKB Professional Keyboard.\n");
            break;
        case 2:
            printf("Best Chair.\n");
            break;
        case 3:
            printf("Samsung Screen 72 Inch.\n");
            break;
        case 4:
            printf("程序员鼓励师.\n");
            break;
        default:
            printf("谢谢参与\n");

    }
#endif

#if 0
    // 关于 switch 的优化，把容易匹配的选择，放到最前面。
    int choice;
    printf(" pls input your choice:\n");
    scanf("%d",&choice);
    switch (choice) {
        case 5:
            printf("谢谢参与\n");
            break;
        case 4:
            printf("程序员鼓励师.\n");
            break;
        case 3:
            printf("Samsung Screen 72 Inch.\n");
            break;
        case 2:
            printf("Best Chair.\n");
            break;
        case 1:
            printf("HHKB Professional Keyboard.\n");
            break;

    }
#endif

    // 关于 switch 实现小范围的选择
    int choice;
    printf(" pls input your choice:\n");
    scanf("%d",&choice);
    switch (choice) {
        case 10:
        case 9:
        case 8:
        case 7:
        case 6:
        case 5:
            printf("谢谢参与\n");
            break;
        case 4:
            printf("程序员鼓励师.\n");
            break;
        case 3:
            printf("Samsung Screen 72 Inch.\n");
            break;
        case 2:
            printf("Best Chair.\n");
            break;
        case 1:
            printf("HHKB Professional Keyboard.\n");
            break;

    }

//    printf("Hello World!\n");
    return 0;
}
